Claim 7: The non-cellular (extracellular) space accounts for 6% of the total volume, less than half the extracellular space estimates from living brains.


In [1]:
import numpy as np
import ndio.remote.neurodata as nd
from datetime import datetime

startTime = datetime.now()

oo = nd()

token = 'kasthuri2015_ramon_v1'
channel = 'neurons'
res = 3
pixel_dim = 0.024*0.024*0.030  #can get from LIMS

In [2]:
import ndio.ramon as ramon

# A priori known bounds for cylinders.  Alternatively we could sweep over entire volume - this is more efficient.
# TODO:  assume that all synapses are inside cylinders, which we know to be true - should do with manual masking or a 
# RAMONId predicate query

xbox = [694,1794]; 
ybox = [1750, 2460];
zbox = [1004, 1379];

# These calls take about 60 seconds to execute
gcyl = oo.get_volume('kat11greencylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)
rcyl = oo.get_volume('kat11redcylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)
bcyl = oo.get_volume('kat11mojocylinder','annotation', xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)

seg_masked = oo.get_volume(token, channel, xbox[0], xbox[1], ybox[0], ybox[1], zbox[0], zbox[1], resolution = res)

mask = (gcyl.cutout + rcyl.cutout + bcyl.cutout) > 0

mask_pixels = sum(sum(sum(mask)))
mask_volume = mask_pixels * pixel_dim
print 'Mask Pixels: ' + str(mask_pixels)
print 'Mask Volume: ' + str(mask_volume) + ' um^3'

seg_pixels = sum(sum(sum(seg_masked.cutout > 0)))
seg_volume =  seg_pixels * pixel_dim

print 'Mask Pixels: ' + str(seg_pixels)
print 'Mask Volume: ' + str(seg_volume) + ' um^3'

print datetime.now() - startTime


Mask Pixels: 90152653
Mask Volume: 1557.83784384 um^3
Mask Pixels: 82232896
Mask Volume: 1420.98444288 um^3
0:01:57.606149

In [3]:
print 1 - float(seg_volume) / mask_volume


0.0878482965998